import request from "@/utils/request";
import { TemplateDetailQuery, TemplateDetailPageResult, TemplateDetailForm, TemplateDetail } from "./model";

/**
 * 模板详情API
 */
class TemplateDetailAPI {

  /**
   * 获取模板详情分页数据
   *
   * @param queryParams
   */
  static getPage(queryParams?: TemplateDetailQuery) {
    return request<any, TemplateDetailPageResult>({
      url:
        "/templateDetail/getPage?currentPage=" +
        queryParams?.pageNum +
        "&size=" +
        queryParams?.pageSize,
      method: "post",
      data: queryParams,
    });
  }

  /**
   * 新增模板详情
   *
   * @param data
   */
  static add(data: TemplateDetailForm) {
    return request({
      url: "/templateDetail/add",
      method: "post",
      data: data,
    });
  }
  /**
   * 修改模板详情
   * @param data 
   * @returns 
   */
  static update(data: TemplateDetailForm) {
    return request({
      url: "/templateDetail/edit",
      method: "post",
      data: data,
    });
  }

  /**
   * 删除模板详情
   * @param data 
   * @returns 
   */
  static delete(data: TemplateDetailForm) {
    return request({
      url: "/templateDetail/delete",
      method: "post",
      data: data,
    });
  }
  /**
   * 获取模板详情列表
   * @param data 
   * @returns 
   */
  static getList(data: TemplateDetailForm) {
    return request<any, TemplateDetail[]>({
      url: "/templateDetail/getList",
      method: "post",
      data: data,
    });
  }

}

export default TemplateDetailAPI;
